<div id="detailShowContent"></div>
<script type="text/html" id="detailContent">
    <div class='layui-row' style='margin-top: 20px;'>
        <div class='layui-col-sm6'>
            <div style='margin:0px 40px;line-height: 27px;'>
                <i class='layui-icon layui-icon-file-b'></i><span>{{ d.name }}({{ d.post }})</span>
                <input type="hidden" value="{{ d.id }}" name="id" id="customer_id"/>
                <input type="hidden" value="{{ d.name }}" name="name" id="customer_name"/>
            </div>
        </div>
        <div class='layui-col-sm6'>
            <div class='layui-btn-group'>
                <button class='layui-btn layui-btn-normal layui-btn-sm' type='button' onclick="editInfo();">编辑</button>
                <button class='layui-btn layui-btn-normal layui-btn-sm' type='button' onclick="setMove();">转移</button>
                <button class='layui-btn layui-btn-normal layui-btn-sm' type='button' onclick="setOpen();">放入公海</button>
                <button class='layui-btn layui-btn-normal layui-btn-sm' type='button' onclick="sendEmail();">发送邮件</button>
                <button class='layui-btn layui-btn-normal layui-btn-sm' type='button' onclick="sendMessage();">发送短信</button>
            </div>
        </div>
    </div>
    <div class='layui-row' style='margin-top: 20px;'>
        <div class='layui-col-sm12'>
            <table class='layui-table' style="text-align: center;">
                <tr>
                    <td>客户星级</td>
                    <td>跟进状态</td>
                    <td>客户名称</td>
                    <td>创建人</td>
                    <td>负责人</td>
                    <td>更新时间</td>
                </tr>
                <tr>
                    <td>
                        {{# for(var ipd in d.clue_level){ }}
                            {{# if(d.level ==ipd){ }}
                                <span>{{ d.clue_level[ipd] }}</span>
                            {{# } }}
                        {{# } }}
                    </td>
                    <td>
                        {{# for(var ipd in d.followStatus){ }}
                            {{# if(d.follow ==ipd){ }}
                                <span>{{ d.followStatus[ipd] }}</span>
                            {{# } }}
                        {{# } }}
                    </td>
                    <td>{{ d.name }}</td>
                    <td>{{ d.create_user_name }}</td>
                    <td>{{ d.owner_user_name }}</td>
                    <td>{{ d.update_time }}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class='layui-row' style='margin-top: 20px;'>
        <div class='layui-col-sm12'>
            <div class='layui-tab layui-tab-card' lay-filter="tabContent">
                <ul class='layui-tab-title'>
                    <li class='layui-this'>跟进记录</li>
                    <li>基础信息</li>
                    <li>联系人</li>
                    <li>合同</li>
                    <li>费用</li>
                    <li>回款信息</li>
                    <li>附件</li>
                </ul>
                <div class='layui-tab-content'>
                    <div class='layui-tab-item layui-show'>
                        <div class='layui-btn-group' style='margin:5px 0px 20px 20px;'>
                            <button class='layui-btn layui-btn-normal layui-btn-sm' type='button'
                                    onclick='showRecord()' ;>新建跟进
                            </button>
                        </div>

                        <table class='layui-hide' id='recordTable' lay-filter='recordTable' lay-size='sm'
                               style='width: 100%'></table>
                    </div>

                    <div class='layui-tab-item'>
                        <div class='layui-card'>
                            <div class='layui-card-header'>基础信息</div>
                            <div class='layui-card-body'>
                                <table style='width: 100%;'>
                                    <tr>
                                        <td>客户名称:{{ d.name }}</td>
                                        <td>助记名称:{{ d.subname }}</td>
                                    </tr>
                                    <tr>
                                        <td>客户所属:
                                            {{# for(var ipd in d.custome_belong){ }}
                                            {{# if(d.belong ==ipd){ }}
                                            <span>{{ d.custome_belong[ipd] }}</span>
                                            {{# } }}
                                            {{# } }}
                                        </td>
                                        <td>客户来源:
                                            {{# for(var ipd in d.clue_source){ }}
                                            {{# if(d.source ==ipd){ }}
                                            <span>{{ d.clue_source[ipd] }}</span>
                                            {{# } }}
                                            {{# } }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>客户状态:{{ d.cost_price }}</td>
                                        <td>客户星级:
                                            {{# for(var ipd in d.clue_level){ }}
                                            {{# if(d.level ==ipd){ }}
                                            <span>{{ d.clue_level[ipd] }}</span>
                                            {{# } }}
                                            {{# } }}
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>所在地区:{{ d.address }}</td>
                                        <td>详细地址:{{ d.address_detail }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>备注信息:{{ d.remarks }}</td>
                                    </tr>

                                </table>
                            </div>
                        </div>
                    </div>

                    <div class='layui-tab-item'>
                        <div class='layui-btn-group' style='margin:5px 0px 20px 20px;'>
                            <button class='layui-btn layui-btn-normal layui-btn-sm' type='button'
                                    onclick="showContacts()" ;>新建联系人
                            </button>
                        </div>
                        <table class='layui-hide' id='contactsTable' lay-filter='contactsTable' lay-size='sm'
                               style='width: 100%'></table>
                    </div>
                    <div class='layui-tab-item'>
                        <div class='layui-btn-group' style='margin:5px 0px 20px 20px;'>
                            <button class='layui-btn layui-btn-normal layui-btn-sm' type='button'
                                    onclick="showContract()" ;>新建合同
                            </button>
                        </div>
                        <table class='layui-hide' id='contractTable' lay-filter='contractTable' lay-size='sm'
                               style='width: 100%'></table>
                    </div>

                    <div class='layui-tab-item'>
                        <div class='layui-btn-group' style='margin:5px 0px 20px 20px;'>
                            <button class='layui-btn layui-btn-normal layui-btn-sm' type='button'
                                    onclick="showConsume()" ;>新建费用
                            </button>
                        </div>
                        <table class='layui-hide' id='consumeTable' lay-filter='consumeTable' lay-size='sm'
                               style='width: 100%'></table>
                    </div>

                    <div class='layui-tab-item'>
                        <div class='layui-btn-group' style='margin:5px 0px 20px 20px;'>
                            <button class='layui-btn layui-btn-normal layui-btn-sm' type='button'
                                    onclick="showReceivables()" ;>新建回款
                            </button>
                        </div>
                        <table class='layui-hide' id='receivablesTable' lay-filter='receivablesTable' lay-size='sm'
                               style='width: 100%'></table>
                    </div>
                </div>
            </div>

        </div>
    </div>
</script>

<script type="text/html" id="tupian2">
    <div class="userinfotitle">
        <div class="uif-avatar">
            <a href="javascript:void(0);" onclick="viewImage('{{ d.files_id }}')">
                <img src="{{ d.files_id }}" class="list_avatar1" alt="" width="50px" height="50px"/>
            </a>
        </div>
    </div>
</script>

<script>
    layui.config({
        base: szoapcpath + '/static/kaige/layuiextend/'
    }).use(['element', 'table', 'form', 'layer', 'kaige', 'glfiles', 'lvybtpl'], function () {
        var element = layui.element,
            layer = layui.layer,
            table = layui.table,
            form = layui.form,
            kaige = layui.kaige,
            laytpl = layui.laytpl,
            glfiles = layui.glfiles,
            lvybtpl = layui.lvybtpl,
            $ = layui.$;

        window.default_image = szoapcpath + "/static/img/default.png";
        //查看图片
        window.viewImage = function (imgUrl) {
            kaige.viewimage({maxwidth: 600, maxheight: 600, url: imgUrl});
        }
    });

</script>